#include<stdio.h>

int main()
{
    int flage1 = 0;
    int flage2 = 0;
    int flage3 = 0;
    int n = 0;
    scanf("%d", &n);
    int arr[n];
    
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
        if(i > 0)
        {
            
            if(arr[i] > arr[i-1])
            {
                flage1 = 1;
            }
            else if(arr[i] < arr[i-1])
            {
                flage2 = 1;
            }
            else
            {
                flage3 = 1;
            }
        }
    }
    if(flage3)
    {
        if((flage1 + flage2 + flage3) <= 2)
        {
        printf("sorted");
        }
    }
    else if(flage1 + flage2 == 1)
    {
        printf("sorted");
    }
    
    return 0;
}
